package com.mmall.concurerency.publish;

import com.mmall.concurerency.annoations.NoThreadSafe;

import java.lang.reflect.Array;
import java.util.Arrays;

@NoThreadSafe
public class Publish {


    private  String [] states = {"a","b","c"};

    public String[] getStates() {
        return states;
    }

    public static void main(String[] args) {
        Publish  publish =  new Publish();
        System.out.println(Arrays.toString(publish.getStates()));
        //这里假如是别的线程修改值，那就会造成线程不安全了
        publish.getStates()[0] = "d";
        System.out.println(Arrays.toString(publish.getStates()));
    }
}
